#include "ModeButtonUpdater.h"
#include <osg/MatrixTransform>

void ModeButtonUpdater::operator()(Node* node, NodeVisitor* nv)
{
	MenuButton* button = static_cast<MenuButton*>(node);
	int mode = GameboardModel::getInstance()->getMode();
	
	if (mode == GameboardModel::MODE_WALL) {
		button->setImage("res/icon_wall.jpg");
	} else if (mode == GameboardModel::MODE_PAWN) {
		button->setImage("res/icon_pawn.jpg");
	}

	traverse(node,nv);
} 